package com.igor.bookStore.tapestry.pages;

import java.util.Collection;

import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.igor.bookStore.inface.User;
import com.igor.bookStore.service.Users;

public class ViewAllUsers {

    @ApplicationState
    private User user;
    private boolean userExists;

    public User getUser() {
            return this.user;
    }

    @Inject
    private Users users;

    public Collection getUsers() {
            return this.users.retrieve();
    }

    Object onActivate() {
            if (!userExists)
                    return Login.class;
            return null;
    }
}
